/**
 * Copyright (C) 2011  E-Robot
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 * @brief Cell.h
 *
 * @date 19 nov. 2010
 * @author elca
 * @version 0.1
 */

#ifndef CELL_H_
#define CELL_H_

#include <qgraphicsitem.h>
#include <QColor>
class Cell:  public QObject,public QGraphicsRectItem
{
	Q_OBJECT
public:

	enum { Type = UserType + 1 };

	enum {Minimum = 0,
		  Maximum = 15};

	int type() const;

	Cell(int x, int y, int width, int height, QGraphicsScene *scene, int value = 0);
	virtual ~Cell();

	void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
	void increment(int _inc);
	int value();
	void setValue(int _value);

public Q_SLOTS:
	void changeMask(int _mask);
	void resetCell();

private:
	bool m_valueHasChanged;
	int m_value;
	int m_drawMask;
};

#endif /* CELL_H_ */
